From: Aaron Schulz Date: Tue, 16 Aug 2016 20:53:57 +0000 (-0700) Subject: Actually enable the DBPerformance log in the API X-Git-Tag: 1.31.0-rc.0~6028^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=1f44e05fb75fc07d3f32154129f47d806a146330;p=lhc%2Fweb%2Fwiklou.git Actually enable the DBPerformance log in the API The logger injection call was missing Change-Id: Ieffc81b1b8437e9765a3a208de7aa430b62806eb --- diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 0478027678..565e829f79 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -25,6 +25,8 @@ * @defgroup API API */ +use MediaWiki\Logger\LoggerFactory; + /** * This is the main API class, used for both external and internal processing. * When executed, it will create the requested formatter object, @@ -206,7 +208,7 @@ class ApiMain extends ApiBase { $config->get( 'CrossSiteAJAXdomainExceptions' ) ) ) ) { - MediaWiki\Logger\LoggerFactory::getInstance( 'cors' )->warning( + LoggerFactory::getInstance( 'cors' )->warning( 'Non-whitelisted CORS request with session cookies', [ 'origin' => $originHeader, 'cookies' => $sessionCookies, @@ -1453,6 +1455,7 @@ class ApiMain extends ApiBase { protected function setRequestExpectations( ApiBase $module ) { $limits = $this->getConfig()->get( 'TrxProfilerLimits' ); $trxProfiler = Profiler::instance()->getTransactionProfiler(); + $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) ); if ( $this->getRequest()->hasSafeMethod() ) { $trxProfiler->setExpectations( $limits['GET'], __METHOD__ ); } elseif ( $this->getRequest()->wasPosted() && !$module->isWriteMode() ) {